<?php

require_once ('BaseService.php');

/**
 * Description of SolicitudesService
 *
 * @author MFerreira
 */
class SolicitudesService extends BaseService {

    public function __construct($serviceBaseURL) {
        parent::__construct($serviceBaseURL);
    }

    public function getServiceClass() {
        return "Solicitudes";
    }

    function GetAll() {
        $response = parent::invokeService("GetAll");
        $result = $response;

        if ($this->shouldDecode) {
            Loader::using("models::entities::Solicitudes");
            $decoder = parent::getSerializer(parent::getMimeType(), "Solicitudes", Solicitudes::MAPPING());
            $result = $decoder->deserializeArray($response);
        }
        return $result;
    }

    function GetById($Id) {
        $response = parent::invokeService("GetById", $Id);
        $result = $response;

        if ($this->shouldDecode) {
            Loader::using("models::entities::Solicitudes");
            $decoder = parent::getSerializer(parent::getMimeType(), "Solicitudes", Solicitudes::MAPPING());
            $result = $decoder->deserialize($response);
        }

        return $result;
    }

    function Create(Solicitudes $Solicitud) {
        $serializer = parent::getSerializer(parent::getMimeType(), "Solicitudes");
        $data = $serializer->serialize($Solicitud);
        $response = parent::invokeService("Insert", $data);
        return $response;
    }

    function Update(Solicitudes $Solicitud) {
        $serializer = parent::getSerializer(parent::getMimeType(), "Solicitudes");
        $data = $serializer->serialize($Solicitud);
        $response = parent::invokeService("Update", $data);
        return $response;
    }

    function GetByEstado($Estado) {
        $response = parent::invokeService("GetByEstado", $Estado);
        $result = $response;

        if ($this->shouldDecode) {
            Loader::using("models::entities::Solicitudes");
            $decoder = parent::getSerializer(parent::getMimeType(), "Solicitudes", Solicitudes::MAPPING());
            $result = $decoder->deserializeArray($response);
        }

        return $result;
    }

    function GetByPlanEstudio($CodigoPlan) {
        $response = parent::invokeService("GetByPlanEstudio", $CodigoPlan);
        $result = $response;

        if ($this->shouldDecode) {
            Loader::using("models::entities::Solicitudes");
            $decoder = parent::getSerializer(parent::getMimeType(), "Solicitudes", Solicitudes::MAPPING());
            $result = $decoder->deserializeArray($response);
        }

        return $result;
    }
    
    function GetByEmpresa($idEmpresa) {
        $response = parent::invokeService("GetByEmpresa", $idEmpresa);
        $result = $response;

        if ($this->shouldDecode) {
            Loader::using("models::entities::Solicitudes");
            $decoder = parent::getSerializer(parent::getMimeType(), "Solicitudes", Solicitudes::MAPPING());
            $result = $decoder->deserializeArray($response);
        }

        return $result;
    }

}

?>
